package BasicSrc;

/*
 * Author: JacksonCoder
 * FileName: demo1
 * Version: 1.0.0
 * Date: 2025/5/24
 */

import java.util.Arrays;
import java.util.List;

public class demo1 {

    public static void main(String[] args) {
        String str = "abcdefg";
        char[] ch = str.toCharArray();
        for (char c : ch) {
            System.out.printf("the word is %c\t, type is %s\n", c, ((Object) c).getClass().getSimpleName());
            System.out.println(type(c));
        }

        String[] words = {"a", "b", "c"};
        List<String> list = Arrays.asList(words);
        System.out.println(list);
        System.out.println(Arrays.toString(list.toArray()));
        System.out.println((type(list)));

    }

    public static String type(Object obj) {
        return obj == null ? "null" : obj.getClass().getSimpleName();
    }

}
